package pet;

import java.lang.reflect.ParameterizedType;

public class Text {

    public static void main(String[] args) {
        Pet dog = new Dog();
        Pet cat = new Cat();
        Pet reddit = new Rabbit();

        text(dog);
    }

    public static void text(Pet pet){
        pet.eat();

        if (pet instanceof LaBaBaBahavior){
            LaBaBaBahavior lb = (LaBaBaBahavior) pet;
            lb.lababa();
        }
        if (pet instanceof EatBaBaBahavior){
            EatBaBaBahavior eb = (EatBaBaBahavior) pet;
            eb.eatbaba();
        }
        if (pet instanceof CatchMouseBahavior){
            CatchMouseBahavior cm = (CatchMouseBahavior) pet;
            cm.catchMouse();
        }
        if (pet instanceof RunBahavior){
            RunBahavior rb = (RunBahavior) pet;
            rb.run();
        }
        if (pet instanceof SwimBahavior){
            SwimBahavior sb = (SwimBahavior) pet;
            sb.swimba();
        }
    }
}
